package restless.core.gameObjs {
	
	import flash.display.Bitmap;
	import flash.display.Stage;
	import restless.core.RestlessEngine;
	import restless.utilities.Benchmark;
	
	import restless.core.interfaces.IDispose;
	import restless.core.interfaces.IStage;
	import restless.core.interfaces.IUR;
	import com.greensock.TweenLite;
	
	/**
	 * 
	 * @author Jordan Laine
	 * 
	 */
	
	public class RLEUpdateRenderObj extends Object implements IDispose, IUR {
		
		protected var stage:Stage;
		protected var RE:RestlessEngine;
		protected var mark:Benchmark;
		
		private var _update:Boolean;
		private var _render:Boolean = true;
		private var _nID:Number;
		private var _sID:String;
		
		public function RLEUpdateRenderObj() {
			
		}
		
		public function setRE():void {
			RE = RestlessEngine.instance;
			stage = RE.stage;
		}
		
		public function update():void{
			
		}
		
		public function render():void {
			
		}
		
		public function set updating(bool:Boolean):void {
			if (bool == _update) { return; }
			_update = bool;
			
			if (_update) { 
				RE.addToUpdate(this);
			} else {
				RE.removeFromUpdate(this);
			}
		}
		
		public function get updating():Boolean {
			return _update;
		}
		
		public function set rendering(bool:Boolean):void {
			if (bool == _render) { return; } 
			_render = bool;
		}
		
		public function get rendering():Boolean {
			return _render;
		}
		
		public function set nID(num:Number):void {
			_nID = num;
		}
		
		public function get nID():Number {
			return _nID;
		}
		
		public function set sID(string:String):void {
			_sID = string;
		}
		
		public function get sID():String {
			return _sID;
		}
		
		public function dispose():void {
			updating = false;
			rendering = false;
			mark = null;
			stage = null;
			RE = null;
		}
		
	}

}